<?php

namespace app\admin\controller;

use think\Controller;

use data\model\Article;

class Index extends BaseController
{

    public function index(){
        /** 获取相应信息记载 */
        //用户上次登陆信息
        $prevLoginInfo = session('prevLoginInfo');
        $this->assign('loginInfo',$prevLoginInfo);

        //获取统计信息
        $totalWebInfo = $this->getWebInfo();
        $this->assign('totalWebInfo',$totalWebInfo);

        return $this->fetch('admin/main');
    }

    /**
     * 获取后台统计信息
     * @desc
     * @author 16
     * @date 2018/2/24
     */
    private function getWebInfo(){
        $artNum = Article::count();

        return [
            'artNum'=>$artNum
        ];
    }
    
}
